//
// Created by root on 2020/4/28.
//

#include "Room.h"

CRoom::CRoom(const std::string &_csRoomId, const std::string &_csClientId01, const std::string &_csClientId02) {
    m_sRoomId = _csRoomId;
    m_setClient.insert(_csClientId01);
    m_setClient.insert(_csClientId02);
}

CRoom::~CRoom() {

}

bool CRoom::operator==(const CRoom &_coRoom) const {
    return m_sRoomId == _coRoom.GetRoomId();
}

bool CRoom::operator==(const std::string &_csRoomId) const {
    return m_sRoomId == _csRoomId;
}

bool CRoom::ContainChatName(const std::string &_sClient) const {
    return m_setClient.find(_sClient) != m_setClient.end();
}

bool CRoom::operator<(const CRoom &_coRoom) const {
    return m_sRoomId < _coRoom.GetRoomId();
}

bool CRoom::operator>(const CRoom &_coRoom) const {
    return m_sRoomId > _coRoom.GetRoomId();
}


